#include <string.h>
#include <stdio.h>

#include <CompileVisitor.h>

#include "AstNodeExpressionVariable.h"

AstNodeExpressionVariable::AstNodeExpressionVariable(const char * varName)
{
  this->name=strdup(varName);
}

void AstNodeExpressionVariable::compile(CompileVisitor * visitor)
{
  visitor->compile(this);
}


#if 0
int AstNodeExpressionVariable::compile(ClassFile * klass, MethodInfo * method)
{
  u2 ii=index*2;
  switch(ii) {
    case 0:
      method->assemble(OPC_dload_0);
      break;
    case 1:
      method->assemble(OPC_dload_1);
      break;
    case 2:
      method->assemble(OPC_dload_2);
      break;
    default:
      method->assemble(OPC_dload,ii);
      break;
  }
  return 0;
}
#endif


void AstNodeExpressionVariable::dump(int level)
{
  printf("exprVar<%s>",name);
}
